package com.woniu.micropropertyserver.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.microcommonsserver.entity.CarPassInfoEntity;
import com.woniu.micropropertyserver.mapper.PassCarInfoMapper;
import com.woniu.micropropertyserver.service.IPassCarInfoService;
import com.woniu.micropropertyserver.util.PageRest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：bb
 * @date ：Created in 2021/2/2 0002
 * @description：
 * @modified By：
 * @version: $
 */
@Transactional(readOnly = true)
@Service
public class PassCarInfoServiceImpl implements IPassCarInfoService {
//public class PassCarInfoServiceImpl{

    @Resource
    private PassCarInfoMapper passCarInfoMapper;

    @Override
    public PageInfo<CarPassInfoEntity> findByParam(PageRest pageRest, CarPassInfoEntity carPassInfoEntity) {
        return PageHelper.startPage(pageRest.getPageNum(),pageRest.getPageSize()).doSelectPageInfo(()->passCarInfoMapper.findByParam(pageRest,carPassInfoEntity));
    }

    @Override
    public List<CarPassInfoEntity> ExportAll(CarPassInfoEntity carPassInfoEntity) {
        return passCarInfoMapper.ExportAll(carPassInfoEntity);
    }

    @Override
    public CarPassInfoEntity findByNum(String passCarNum) {
        return passCarInfoMapper.findByNum(passCarNum);
    }
}
